<%@page import="java.util.Date"%>
<%@page import="board.BoardVo"%>
<%@page import="java.util.Vector"%>
<%@page import="board.Board"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>

<body>

<%
	String str = request.getParameter("find");
	if(str != null) System.out.println("키워드 : " + str);
%>
	<jsp:useBean id="vo" class="board.BoardVo"></jsp:useBean>
	<jsp:setProperty property="*" name="vo" />		
<% 		
		String part = "B";
		vo.setPart(part);

		Board b = new Board();
		b.setVo(vo);
		b.setNowPage(vo.getNowPage());
		Vector<BoardVo> v = b.list();
		
		out.print("var jsonArray=[");
		for(int i=0;i<v.size();i++){
			BoardVo bb = v.get(i);

			out.print("{mid: \'" + bb.getMid() + "\', ");
			//out.print("startPage: \'" + b.getStartPage() + "\', ");
			//out.print("endPage: \'" + b.getEndPage() + "\', ");
			//out.print("nowBlock: \'" + b.getNowBlock() + "\', ");
			//out.print("totBlock: \'" + b.getTotBlock() + "\', ");
			//out.print("totPage: \'" + b.getTotPage() + "\', ");
			out.print("subject: \'" + bb.getSubject() + "\', ");
			out.print("mdate: \'" + bb.getMdate() + "\', ");
			out.print("hit: \'" + bb.getHit() + "\'}");
			
			if(i<v.size() - 1) out.print(",");
		}
		
		out.print("];");
		
		out.print("var pageInfo={");
		out.print("totPage: \'" + b.getTotPage() + "\', ");
		out.print("startPage: \'" + b.getStartPage() + "\', ");
		out.print("endPage: \'" + b.getEndPage() + "\'}");

%>
</body>
</html>